﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Spymaster.Entities;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Spymaster.Entities.Components
{
    public class RenderComponent
    {
        private GameEntity entity;

        public RenderComponent(GameEntity entity)
        {
            this.entity = entity;
        }

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            Rectangle entityRectangle = new Rectangle(
                (int)entity.Position.X, (int)entity.Position.Y, 
                entity.EntityImage.Width, entity.EntityImage.Height);

            spriteBatch.Draw(entity.EntityImage, entity.Position,
                new Rectangle(0, 0, entity.EntityImage.Width, entity.EntityImage.Height),
                Color.White, entity.Rotation,
                new Vector2(entity.EntityImage.Width / 2, entity.EntityImage.Height / 2),
                1.0f, SpriteEffects.None, 1);
        }
    }
}
